﻿using Camc.Quality.RecordTable.FormBase;
using Camc.Quality.RecordTable.FormClass;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Camc.Quality.RecordTable.FormEntity
{
    public class 管路活门气密点检查记录表氦质谱法 : TableBase
    {
        public 管路活门气密点检查记录表氦质谱法(int serialNum, Guid workStepEntityId, Guid processesEntityId, int sort, string parentProductNum, string fisrtDrawingNum, string secondDrawingNum, string recordElement, string toolUsed)
        {
            SerialNum = serialNum;
            WorkStepEntityId = workStepEntityId;
            ProcessesEntityId = processesEntityId;
            Sort = sort;

            ParentProductNum = parentProductNum;
            FisrtDrawingNum = fisrtDrawingNum;
            SecondDrawingNum = secondDrawingNum;
            RecordElement = recordElement;
            ToolUsed = toolUsed;
        }
        public override string FormName { get; protected set; } = "管路活门气密点检查记录表氦质谱法";

        public override string ParentProductNum_DisplayName { get; protected set; } = "系统名称";
        public override bool ParentProductNum_Show { get; protected set; } = true;
        public override int ParentProductNum_Property { get; protected set; } = 2; //由0变为2
        public override string FisrtDrawingNum_DisplayName { get; protected set; } = "测点前管路图号";
        public override bool FisrtDrawingNum_Show { get; protected set; } = true;

        public override string SecondDrawingNum_DisplayName { get; protected set; } = "测点后管路图号";
        public override bool SecondDrawingNum_Show { get; protected set; } = true;

        public override string RecordElement_DisplayName { get; protected set; } = "检查方法";
        public override bool RecordElement_Show { get; protected set; } = true;

        public override string ToolUsed_DisplayName { get; protected set; } = "所用工具编号";
        public override bool ToolUsed_Show { get; protected set; } = true;
        public override bool ToolUsed_Enable { get; protected set; } = true;
        public override int ToolUsed_Property { get; protected set; } = 2;

        public RecordRequirementsEntity SetRecordRequirements(RecordRequirementsEntity entity, string recordRequire, string designerDemand, string processorDemand, string remarks)
        {
            entity.SetRecordRequire(recordRequire, "检查压力(MPa)", false, true, 0);
            entity.SetDesignerDemand(designerDemand, "设计要求值Pa*m3/s", false, true, 0);
            entity.SetProcessorDemand(processorDemand, "工艺要求值", false, true, 0);
            entity.SetRemarks(remarks, "备注", false, true, 0);
            return entity;
        }
        public MeasuredResultEntity SetMeasuredResult(MeasuredResultEntity entity, string firstMeasuredValues, string secondMeasuredValues, string thirdMeasuredValues, string fourthMeasuredValues)
        {
            entity.SetFirstMeasuredValues(firstMeasuredValues, "检查点输出Pa•m3/s", true, true, 0);
            entity.SetSecondMeasuredValues(secondMeasuredValues, "检查点漏率Pa•m3/s", true, true, 0);
            entity.SetThirdMeasuredValues(thirdMeasuredValues, "比对漏孔漏率Pa•m3/s", true, true, 2);
            entity.SetFourthMeasuredValues(fourthMeasuredValues, "比对装置输出Pa•m3/s", true, true, 2);
            return entity;
        }
        /// <summary>
        /// 插入环境要素
        /// </summary>
        public EnvironmentEntity SetEnvironment(EnvironmentEntity entity, string temperature, string humidity, string atmPressure)
        {
            entity.SetTemperature(temperature, "温度", true, true, 2);
            entity.SetHumidity(humidity, "湿度", true, true, 2);
            entity.SetAtmPressure(atmPressure, "大气本体Pa•m3/s", true, true, 2);
            return entity;
        }
    }
}
